<%--
  Created by IntelliJ IDEA.
  User: a
  Date: 2022/1/11
  Time: 16:30
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>登录页面-学生成绩管理系统-javaweb实战</title>
    <style>
        #container div{
            text-align: center;
            padding: 15px;
        }
        #container div:last-child input:first-child{
            margin-right: 30px;
        }
        #container div:last-child input:last-child{
            margin-left: 30px;
        }

    </style>
</head>
<body>
<div style="margin-top: 100px">
<jsp:include page="top.jsp"/>
<div id="container">
    <%
        String message=(String) request.getAttribute("message");
        if (message!=null){
    %>
    <h3 style="color: red;text-align: center">出错信息：${message}</h3>
    <%
        }
    %>
<%--    action的内容动态获取，再修改路径之后就不需要修改了--%>
    <form action="<%= request.getContextPath()%>/loginServlet?type=trueLogin" method="post">
        <div>
            <%--点击用户名，input就会自动获取焦点--%>
            <label for="userName">
                用户名:
            </label>
            <input type="text" name="userName" id="userName"/>
        </div>
        <div>
            <label>
                密&nbsp;&nbsp;&nbsp;码:
                <input type="password" name="pwd"/>
            </label>
        </div>
        <div>
            <input type="submit" value="登录">
            <input type="button" onclick="resetForm()" value="重置">
        </div>
    </form>
</div>
<jsp:include page="bottom.jsp"/>
</div>
<script>
    function resetForm(){
        document.forms[0].reset();
    }
</script>
</body>
</html>
